import { URI } from "@/services/api";
import {request, METHOD,} from '@/utils/request'


export async function list(search, pageIndex, pageSize) {
  return request(`${URI}/Role/GetData`, METHOD.GET, {
    search: search,
    pageIndex: pageIndex,
    pageSize: pageSize
  })
}

export async function save(model) {
  return request(`${URI}/Role/Save`, METHOD.POST, model);
}

export async function detail(id) {
  return request(`${URI}/Role/GetModel`, METHOD.GET, {
    id: id,
  });
}

export async function remove(id) {
  return request(`${URI}/Role/Remove?id=`+id, METHOD.POST);
}


export async function getAll(id) {
  return request(`${URI}/Role/GetAll`, METHOD.GET, {
    id: id,
  });
}

export default {
  list,
  save,
  detail,
  remove,
  getAll
}
